package nc.tb.ufo.ui;

import java.awt.Container;
import java.awt.Window;
import java.util.HashMap;
import javax.swing.JOptionPane;

import nc.tb.app.CommonPlan;
import nc.tb.cube.CubeView;
import nc.tb.cube.model.Plan;
import nc.tb.report.plugin.TbReport;
import nc.ui.pub.ClientEnvironment;
import com.ufsoft.report.ContextVO;

public class TbReportInstanceManager {
	private static TbReportInstanceManager _instance = new TbReportInstanceManager();
	
	public static TbReportInstanceManager getInstance() {
		/*if (_instance == null) {
			_instance = new TbReportInstanceManager();
		}*/
		return _instance;
	}
	public TbReport createReport(Plan plan, CubeView cbView, int nMode) {
		int oper = TbReport.OPERATION_INPUT;
		if (nMode == IMode.STYLESHEET
				/*|| (nMode == IMode.PLAN && (plan != null && plan instanceof CommonPlan) && (cbView != null && cbView.isFormatview()))*/)
			oper = TbReport.OPERATION_FORMAT;
		ContextVO ctx = new ContextVO();
		ctx.setAttribute("key_CURRENT_LANG",ClientEnvironment.getInstance().getLanguage());
		TbReport report = new TbReport(oper, ctx, nMode);
		report.setOperationState(oper);
		return report;
	}
	public void disposeReport(Plan plan, CubeView cbView, int nMode) {
	}
}
